﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/User.Master" AutoEventWireup="true" CodeBehind="DashBoard.aspx.cs" Inherits="CRMWeb.Pages.DashBoard" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    
    <div id="pnlapptitles" class="easyui-panel master_content" style="width: 1150px; height: 895px; background-color: #d6e3bc">
        <div data-options="region:'center'" style="height: auto;">
             <table cellspacing="0" selectionMode="single"  class="history_table" style="padding-left:50px;padding-top:50px;" cellpadding="0" border="0" >
                   <tr>
                        <td style="width:150px; vertical-align: top;">
                            <table id="dgNoticeDashboard" style="width: 360px;height:340px;" 
                            pagination="false" data-options="pageSize:20" 
                            rownumbers="true" fitcolumns="true" singleselect="true" autorowheight="true">
                                <thead >
                                <tr>
                                    <th field="NoticeTitle" data-options="formatter:DisplayTooltipF"  width="7px">Title</th>
                                    <th field="Edit_Date" width="7px">Last Edit Date</th>    
                                </tr>
                            </thead>
                                </table>
                            </td>
                        <td style="width: 58%; vertical-align: top;padding-left:5px;">
                        <div id="divShowDes" class="easyui-panel" title="Notice Description"  style="height: 340px;width:370px;padding-left:7px;padding-right:7px;padding-bottom:7px;padding-top:7px;">  
                        </div>
                    </td>
                       </tr>
                 </table>
            </div>
    </div>
    <script type="text/javascript">
        fnLeftNavSelected('A5');
        $(document).ready(function () {
            ShowRecentNotice();
        });
      
        

        $(document).ready(function () {
            $('#dgNoticeDashboard').datagrid({
                url: '/WebServices/Notice.ashx?method=ShowLatestNotice',
                onClickRow: function (index, rowdata)
                {

                    if (rowdata.NoticeDescription == null)
                        $('#divShowDes').html('');
                    else {
                        var data = decodeURIComponent(rowdata.NoticeDescription);
                        $('#divShowDes').html(data);
                    }
                },
                onLoadSuccess: function () {
                    $(this).datagrid('selectRow', 0);
                    // select first row
                },
                onSelect: function (index, rowdata)
                {
                    var data = decodeURIComponent(rowdata.NoticeDescription);
                    $('#divShowDes').html(data);
                },
               
               
            });
        });

       

        function DisplayTooltipF(val, row) {

            return '<span style="width: 50%;Height:60%"  title="' + row.NoticeTitle + '" class="easyui-tooltip">' + row.NoticeTitle + '</span>';
        }


        function ShowRecentNotice() {
            $.ajax({
                url: "/WebServices/Notice.ashx?method=ShowLatestNotice",
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    $.each(eval(data.replace(/[\r\n]/, '')), function (i, rec)
                    {
                       
                        $('#txtNoticeDescription').panel({
                            title: rec.NoticeTitle,

                        });

                          var data = decodeURIComponent(rec.NoticeDescription);
                            $('#txtNoticeDescription').html(data);
                       
                    });
                }
            });
        }
    </script>
</asp:Content>

